home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 January / PCWorld_2007-01_cd.bin / v cisle / hotkey / AutoHotkey104504_Install.exe / Extras / ahk.vim < prev    next >
Text File  |  2005-04-16  |  2KB  |  72 lines

  1. " Vim syntax file
  2.  
  3. " Language:    Autohotkey from www.autohotkey.com
  4. " Maintainer:   savage - kallen19918 AT earthlink DOT net
  5.  
  6. "Usage:
  7. "1) Copy this file into your $VIM/syntax directory.
  8. "2) Add this line to filetype.vim:
  9. "au BufNewFile,BufRead *.ahk setf ahk 
  10.  
  11.  
  12.  
  13. " For version 5.x: Clear all syntax items
  14. " For version 6.x: Quit when a syntax file was already loaded
  15. if version < 600
  16.   syntax clear
  17. elseif exists("b:current_syntax")
  18.   finish
  19. endif 
  20.  
  21. sy case ignore
  22.  
  23. sy keyword ahkKeyword ahk_id ahk_pid ahk_class ahk_group ahk_parent true false
  24.  
  25. sy match ahkFunction "^\s*\w\{1,},"
  26. sy match ahkFunction "\w\{1,}," contained
  27. sy match ahkFunction "^\s*\w\{1,}\s*$" contains=ahkStatement
  28. sy match ahkFunction "\w\{1,}\s*$" contained
  29.  
  30. sy match ahkNewFunction "\s*\w\{1,}(.*)"
  31. sy match ahkNewFunctionParams "(\@<=.*)\@=" containedin=ahkNewFunction
  32.  
  33. sy match ahkEscape "`." containedin=ahkFunction,ahkLabel,ahkVariable,ahkNewFunctionParams
  34.  
  35. sy match ahkVariable "%.*%" containedin=ahkNewFunctionParams
  36. sy match ahkVariable "%.*%"
  37.  
  38.  
  39.  
  40. sy match ahkKey "[!#^+]\{1,4}`\=.\n" contains=ahkEscape
  41. sy match ahkKey "[!#^+]\{0,4}{.\{-}}"
  42.  
  43.  
  44. sy match ahkDirective "^#[a-zA-Z]\{2,\}"
  45.  
  46. sy match ahkLabel "^\w\+:\s*$"
  47. sy match ahkLabel "^[^,]\+:\{2\}\(\w\+,\)\="  contains=ahkFunction
  48. sy match ahkLabel "^[^,]\+:\{2\}\w\+\s*$" contains=ahkFunction
  49. sy match ahkLabel "^:.\+:.*::"
  50. sy keyword ahkLabel return containedin=ahkFunction
  51.  
  52. sy match ahkStatement "^\s*if\w*\(,\)\="
  53. sy keyword ahkStatement If Else Loop Loop, exitapp containedin=ahkFunction
  54.  
  55. sy match ahkComment "`\@<!;.*" contains=NONE
  56. sy match ahkComment "\/\*\_.\{-}\*\/" contains=NONE
  57.  
  58.  
  59. hi def link ahkKeyword Special
  60. hi def link ahkEscape Special
  61. hi def link ahkComment Comment
  62. hi def link ahkStatement Conditional
  63. hi def link ahkFunction Type
  64. hi def link ahkDirective Include
  65. hi def link ahkLabel Label
  66. hi def link ahkKey Special
  67. hi def link ahkVariable Constant
  68. hi def link ahkNewFunction Type
  69.  
  70. sy sync fromstart
  71. let b:current_syntax = "ahk" 
  72.